<script type="text/javascript">
	<!--
		var goods_id="<{$collocation.goods_id}>";
		var collocation=function(s){
			this.dialog = new Dialog('index.php?ctl=plugins/ctl_collocate_goods&act=showCollocationInfo&goods_id='+goods_id+'&_form='+(s?s:'goods-collocation'));
		}
	//-->
</script>
<h3><{t}>搭配商品<{/t}></h3>
<input type="hidden" name="goods[collocation][listen]" value="1" />
<div class="tableform">
<{button label="添加搭配商品" type="button" onclick="collocation.bind(goodsEditor)('goods-collocation')" icon="btn_add.gif"}>
<div class="adjs" id="goods-collocation">
<{if $showRow}>
<{foreach from=$goods.collocation item=collocation key=key}>
<{if collocation.type}>
<div class="division">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th><{t}>搭配组名称：<{/t}></th>
    <td><{input type="text" name="goods[collocation][name][{$key}]" value=$collocation.name}>
<input type="hidden" name="goods[collocation][type][<{$key}>]" value="<{$collocation.type}>"><span class="sysiconBtn delete" onclick="this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode.parentNode.parentNode)"><{t}>删除此组搭配<{/t}></span></td>
  </tr>
  <tr>
    <th><{t}>最小购买量：<{/t}></th>
    <td><{input type="unsigned" name="goods[collocation][min_num][{$key}]" size="3" value=$collocation.min_num}></td>
  </tr>
  <tr>
    <th><{t}>最大购买量：<{/t}></th>
    <td><{input type="unsigned" name="goods[collocation][max_num][{$key}]" size="3" value=$collocation.max_num}></td>
  </tr>
  <tr>
    <th><{t}>搭配商品优惠：<{/t}></th>
    <td><input type="radio" name="goods[collocation][set_price][<{$key}>]" value="discount" <{if $collocation.set_price!='minus'}>checked=checked<{/if}>>优惠某个折扣
  <input type="radio" name="goods[collocation][set_price][<{$key}>]" value="minus" <{if $collocation.set_price=='minus'}>checked=checked<{/if}>><{t}>优惠一定金额<{/t}></td>
  </tr>
  <tr>
    <th><{t}>优惠额度：<{/t}></th>
    <td><{input type="unsigned" value=$collocation.price name="goods[collocation][price][{$key}]" size="3" }><{t}>&nbsp;&nbsp;(无优惠可不填；优惠9折就输入0.9，优惠100元就输入100)<{/t}></td>
  </tr>
  <tr>
	<th>是否强制使用搭配：</th>
	<td><input type="radio" name="goods[collocation][isBind][<{$key}>]" value="1" <{if $collocation.isBind neq '0'}>checked=checked<{/if}> />是,作为捆绑商品
	<input type="radio" name="goods[collocation][isBind][<{$key}>]" value="0" <{if $collocation.isBind eq '0'}>checked=checked<{/if}> />否,让客户自由搭配</td>
  </tr>
  <tr>
	<th>是否显示原价：</th>
	<td><input type="radio" name="goods[collocation][isShowOriPrice][<{$key}>]" value="1" <{if $collocation.isShowOriPrice neq '0'}>checked=checked<{/if}> />是
	<input type="radio" name="goods[collocation][isShowOriPrice][<{$key}>]" value="0" <{if $collocation.isShowOriPrice eq '0'}>checked=checked<{/if}> />否</td>
  </tr>
  <tr>
	<th>是否显示"节省了"：</th>
	<td><input type="radio" name="goods[collocation][isShowSaving][<{$key}>]" value="1" <{if $collocation.isShowSaving neq '0'}>checked=checked<{/if}> />是
	<input type="radio" name="goods[collocation][isShowSaving][<{$key}>]" value="0" <{if $collocation.isShowSaving eq '0'}>checked=checked<{/if}> />否</td>
  </tr>
  <th><{t}>添加搭配商品：<{/t}></th>
    <td>
		<{if $collocation.type eq "goods"}>
		<{input value=$collocation.items type="object:goods/products" name="goods[collocation][items][{$key}]" cols="name" multiple="true"}>
		<{elseif $collocation.type eq "filter"}>
		<{filter type="goods/products" from=$collocation.items name="goods[collocation][items][{$key}]"}>
		<{/if}>
	</td>
  </tr>
</table>
</div>
<{/if}>
<{/foreach}>
<{/if}>
</div>
</div>
